package com.gitee.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope   //动态感知 替换Bean Springboot整合Nacos Nacos有一些自定义注解
public class TestController {

    @Value("${common.name}")
    private String name;

    @Value("${common.age}")
    private int age;

    @GetMapping("getUser")
    public String getUser() {
        return "name = " + name + ",age = " + age;
    }

}
